package acme.serviceproviders.data.utility;

import java.nio.*;
import java.util.UUID;

public class Converter {
	
	public static byte[] UUIDToByteArray(UUID value)
	{
		 long msb = value.getMostSignificantBits();
		 long lsb = value.getLeastSignificantBits();
		 byte[] bArray = new byte[16];
		 ByteBuffer bBuffer = ByteBuffer.wrap(bArray);
		 LongBuffer lBuffer = bBuffer.asLongBuffer();
		 lBuffer.put(0, msb);
		 lBuffer.put(1, lsb);
		 
		 return bArray;
	}
}
